package com.program.cloudmanagesystem.hotel.service;

import com.program.cloudmanagesystem.hotel.domain.Human;
import com.program.cloudmanagesystem.hotel.persistence.HumanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HumanService {
    @Autowired
    private HumanMapper humanMapper;
    public HumanService(){}
    public List<Human> showHumen(){
        return humanMapper.showHumen();
    }
    public Human searchHuman(String id){
        return humanMapper.searchHuman(id);
    }
    public void insertHuman(Human human){
        humanMapper.insertHuman(human.getId(), human.getName(), human.getJob(), human.getBase(), human.getBirthday(),human.getOnboard(), human.getSex(), human.getPhone(),human.getHotelid());
    }
    public void deleteHuman(String id)
    {
        humanMapper.deleteHuman(id);
    }
    public void updateData(Human human)
    {
        humanMapper.updateData(human.getId(), human.getName(), human.getJob(), human.getBase(), human.getBirthday(),human.getOnboard(), human.getSex(), human.getPhone(),human.getHotelid());

    }
    public List<Human> showHumanByHotelId(String hotelId){return humanMapper.showHumenByHotelId(hotelId);}
}
